package com.harmontronics.hanma.paas.paas.dto.input.model;

import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.EntityModelTypeEnum;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.RelationTypeEnum;
import io.swagger.annotations.ApiModelProperty;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * ${comments}
 *
 * @author paas-generator
 * @email paas-generator@harmontronics.com
 * @date 2021-03-31 09:10:30
 */
@Data
public class HmEntityModelUpdateInput {

    /**
     * 唯一键
     */
    @ApiModelProperty(value = "唯一键",required = true)
    @NotNull(message = "hm.pass.field_non_nullable")
    private Long id;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称",required = true)
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String name;


    /**
     * 数据类型
     */
    @ApiModelProperty(value = "数据类型")
    private EntityModelTypeEnum type;

    /**
     * 关联类型
     */
    @ApiModelProperty(value = "关联类型")
    private RelationTypeEnum relationType;

    /**
     * 配置信息,当字段的数据类型为关联单选/多选、子表时需要
     */
    @ApiModelProperty(value = "配置信息,当字段的数据类型为关联单选/多选、子表时需要")
    private String config;

    @ApiModelProperty(hidden = true)
    private Boolean builtIn = Boolean.FALSE;

    /**
     * 数据长度
     */
    @ApiModelProperty(value = "数据长度")
    private Integer length;

    /**
     * 是否为空
     */
    @ApiModelProperty(value = "是否为空")
    private Integer nullable;


}
